using System;
using System.Collections.Generic;
using System.Text;
using NBusiness.CodeDom.Compiler;
using NBusiness.CodeDom;
using System.IO;
using Microsoft.CSharp;
using System.CodeDom.Compiler;
using Microsoft.VisualBasic;
using System.CodeDom;

namespace NBusiness.Templates
{
    public abstract class TemplateBase : ITemplate
    {
        #region ITemplate Members

        protected abstract string Compile(Entity entity, EntityCompileParameters parameters);

        string ITemplate.Compile(Entity entity, EntityCompileParameters parameters)
        {
            return this.Compile(entity, parameters);
        }

        public event EventHandler<EntityBuildErrorEventArgs> BuildError;
        protected virtual void OnError(EntityBuildError error)
        {
            if (BuildError != null) BuildError(this, new EntityBuildErrorEventArgs(error));
        }


        #endregion
    }
}
